package tools;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import files.Tweet;
import files.TweetManager;

public class Writer {

	
	public static void writeResult(String filename, String texte)
	{
	
	 PrintWriter nameFile; 
     try
     {
         if(filename.contains(".txt") == false)
         {
        	 filename += ".txt";
         }
         
         nameFile = new PrintWriter(new FileWriter(filename));
         nameFile.print(texte);
         nameFile.flush();
         nameFile.close();
         
     }
     catch(NullPointerException e){ e.printStackTrace();}
     catch(IOException e1){ e1.printStackTrace();}
	}

	
}
